
// io 函子问题

const fp = require("lodash/fp")

class IO {
    static of (val) {
        return new IO(function() {
            return val
        })
    }
    constructor(fn) {
        this._fn = fn
    }
    map(fn) {
        return new IO(fp.flowRight(fn, this._fn))
    }
}

let io = IO.of(process).map(p=>p.execPath)
console.log(io._fn())
